From 7aea18cf0db9f488f9d9bd71d7b11206df0c388c Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 29 Jan 2015 17:54:59 -0500 Subject: [PATCH] deltas: Stub out a few more opcodes --- .../ostree-repo-static-delta-private.h | 1 + .../ostree-repo-static-delta-processing.c | 89 +++++++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/src/libostree/ostree-repo-static-delta-private.h b/src/libostree/ostree-repo-static-delta-private.h index 0661787f..09d4898a 100644 --- a/src/libostree/ostree-repo-static-delta-private.h +++ b/src/libostree/ostree-repo-static-delta-private.h @@ -135,6 +135,7 @@ typedef enum { OSTREE_STATIC_DELTA_OP_OPEN_SPLICE_AND_CLOSE = 'S', OSTREE_STATIC_DELTA_OP_OPEN = 'o', OSTREE_STATIC_DELTA_OP_WRITE = 'w', + OSTREE_STATIC_DELTA_OP_SET_READ_SOURCE = 'R', OSTREE_STATIC_DELTA_OP_CLOSE = 'c' } OstreeStaticDeltaOpCode; diff --git a/src/libostree/ostree-repo-static-delta-processing.c b/src/libostree/ostree-repo-static-delta-processing.c index 4ca40023..cdbd6174 100644 --- a/src/libostree/ostree-repo-static-delta-processing.c +++ b/src/libostree/ostree-repo-static-delta-processing.c @@ -83,6 +83,10 @@ typedef struct { GError **error); OPPROTO(open_splice_and_close) +OPPROTO(open) +OPPROTO(write) +OPPROTO(set_read_source) +OPPROTO(close) #undef OPPROTO static gboolean @@ -223,6 +227,22 @@ _ostree_static_delta_part_execute_raw (OstreeRepo *repo, if (!dispatch_open_splice_and_close (repo, state, cancellable, error)) goto out; break; + case OSTREE_STATIC_DELTA_OP_OPEN: + if (!dispatch_open (repo, state, cancellable, error)) + goto out; + break; + case OSTREE_STATIC_DELTA_OP_WRITE: + if (!dispatch_write (repo, state, cancellable, error)) + goto out; + break; + case OSTREE_STATIC_DELTA_OP_SET_READ_SOURCE: + if (!dispatch_set_read_source (repo, state, cancellable, error)) + goto out; + break; + case OSTREE_STATIC_DELTA_OP_CLOSE: + if (!dispatch_close (repo, state, cancellable, error)) + goto out; + break; default: g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, "Unknown opcode %u at offset %u", opcode, n_executed); @@ -533,3 +553,72 @@ dispatch_open_splice_and_close (OstreeRepo *repo, g_prefix_error (error, "opcode open-splice-and-close: "); return ret; } + +static gboolean +dispatch_open (OstreeRepo *repo, + StaticDeltaExecutionState *state, + GCancellable *cancellable, + GError **error) +{ + gboolean ret = FALSE; + + if (!open_output_target (state, cancellable, error)) + goto out; + + ret = TRUE; + out: + if (!ret) + g_prefix_error (error, "opcode open: "); + return ret; +} + +static gboolean +dispatch_write (OstreeRepo *repo, + StaticDeltaExecutionState *state, + GCancellable *cancellable, + GError **error) +{ + gboolean ret = FALSE; + + g_assert_not_reached (); + + ret = TRUE; + /* out: */ + if (!ret) + g_prefix_error (error, "opcode open-splice-and-close: "); + return ret; +} + +static gboolean +dispatch_set_read_source (OstreeRepo *repo, + StaticDeltaExecutionState *state, + GCancellable *cancellable, + GError **error) +{ + gboolean ret = FALSE; + + g_assert_not_reached (); + + ret = TRUE; + /* out: */ + if (!ret) + g_prefix_error (error, "opcode open-splice-and-close: "); + return ret; +} + +static gboolean +dispatch_close (OstreeRepo *repo, + StaticDeltaExecutionState *state, + GCancellable *cancellable, + GError **error) +{ + gboolean ret = FALSE; + + g_assert_not_reached (); + + ret = TRUE; + /* out: */ + if (!ret) + g_prefix_error (error, "opcode open-splice-and-close: "); + return ret; +} -- 2.30.2